package com.lhj.myapplication.controller;

import com.lhj.myapplication.entity.User;
import com.lhj.myapplication.service.UserService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {
    @Autowired
    private UserService userService;
    @GetMapping("/users")
    @ApiOperation("获取全部用户")
    public List<User> users(){
        return userService.getAll();
    }
}
